import request from "@/plugins/axios";

/**
 * 分页查询资产已入库记录
 * @param searchKeyword
 * @param currentPage
 * @param pageSize
 */
export function searchDisposalAuditList(params) {
    return request({
        url: "/api/asset/handle/audit/page",
        method: "get",
        params
    });
}

/**
 * 查询资产已入库
 * @param id
 */
export function seacrhWarehousing(id) {
    return request({
        url: "/api/asset/fixed/warehousing/already/" + id,
        method: "get"
    });
}

/**
 * 查询处置信息
 * @param id
 */
export function getAssetHandle(id) {
    return request({
        url: "/api/asset/handle/" + id,
        method: "get"
    });
}

/**
 * 新增资产处置信息
 * @param formData
 */
export function addAssetHandle(formData) {
    return request({
        url: "/api/asset/handle",
        method: "post",
        data: formData
    });
}

/**
 * 修改资产处置信息
 * @param formData
 */
export function doAudit(formData) {
    return request({
        url: "/api/asset/handle/doAudit",
        method: "put",
        data: formData
    });
}

/**
 * 校验处置单号唯一性
 * @param path
 */
export function checkDisposalOrderNo(disposalOrderNo) {
    return request({
        url:
            "/api/asset/handle/check-disposalOrderNo?disposalOrderNo=" +
            disposalOrderNo,
        method: "get"
    });
}

/**
 * 校验处置单号唯一性(修改时)
 * @param path
 */
export function checkDisposalOrderNoByUpdate(disposalOrderNo, assetHandleId) {
    return request({
        url:
            "/api/asset/handle/check-disposalOrderNo-update?disposalOrderNo=" +
            disposalOrderNo +
            "&assetHandleId=" +
            assetHandleId,
        method: "get"
    });
}
